package com.york.tinyrpc.protoss.springboot.startert.annotation;

import com.york.tinyrpc.protoss.springboot.startert.bootstrap.TinyRpcConsumerBootstrap;
import com.york.tinyrpc.protoss.springboot.startert.bootstrap.TinyRpcInitBootstrap;
import com.york.tinyrpc.protoss.springboot.startert.bootstrap.TinyRpcProviderBootstrap;
import org.springframework.context.annotation.Import;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 是否启用 TinyRpc 注解
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Import({TinyRpcInitBootstrap.class, TinyRpcProviderBootstrap.class, TinyRpcConsumerBootstrap.class})
public @interface EnableTinyRpc {

    /**
     * 是否需要启动 server
     * consumer不需要
     * provider需要
     */
    boolean needServer() default true;
}